package com.java.simple.study.juc.p1;

import com.java.simple.study.constant.Constant;
import com.java.simple.study.tool.FileReader;
import lombok.extern.slf4j.Slf4j;

/**
 * @author zhoujunlin
 * @date 2022年04月05日 15:23
 * @desc
 */
@Slf4j(topic = "c.AboutASync")
public class AboutASync {

    public static void main(String[] args) {
//        sync();
        async();
    }


    public static void sync() {
        FileReader.read(Constant.BIG_FILE_PATH);
        log.debug("do other things ...");
    }

    public static void async() {
        new Thread(() -> FileReader.read(Constant.BIG_FILE_PATH)).start();
        log.debug("do other things ...");
    }

}
